A method of allocating a compression code to character information such as characters or words using a compression algorithm such as a Huffman coding or LZ78 to compress the character information is known. In a compression process based on such a compression algorithm, a process of preparing a list of items of character information to which compression codes are allocated, searching the list using character information that matches compression target character information to obtain character information, and generating compressed data using a compression code associated with the character information obtained as the search result is performed.
The searching performed in the compression process is performed by comparing the character information in the list with the compression target character information, and the character information in the list matching the compression target character information is specified as the comparison result. Before comparing with the character information in the list, a range of comparison targets in the list may be narrowed down using an index prepared in advance.
Patent Document 1: Japanese Laid-open Patent Publication No. 2012-142024
Patent Document 2: Japanese Laid-open Patent Publication No. 05-224878
Further, a compression code may be allocated to a combination of character strings such as words to express two or more character strings by one compression code. By doing so, a compression ratio can be improved. However, when a character string read from a compression target file is compressed, searching of a compression code allocated to the character string and searching of a compression code allocated to a combination that includes the character string may be performed redundantly. In particular, the searching of the combination of character strings involves comparing with a combination of character strings to which a compression code is allocated, and the comparison target character string is longer than the unit of character strings to which a compression code is allocated. Thus, the amount of processing needed for the searching increases.